package com.zjitc.book.mapper;

import com.zjitc.book.entity.Book;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface BookMapper {
    @Select("select * from book")
    public List<Book> getBooks();

    @Select("select * from book where id=#{id}")
    public Book getBookById(@Param("id") Long id);

    public List<Book> searchBooksByCon(Book book);
    @Update("update product.book set name=#{name},type=#{type} where id=#{id}")
    public void UpdateBook(Book book);

    @Delete("delete from product.book where id=#{id}")
    public void deleteBookById(int id);

    @Insert("insert into product.book (name,type) values (#{name},#{type})")
    public void addBook(Book book);
}
